<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <script src="js/swiper-4.2.6.min.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="css/swiper-4.2.6.min.css"/>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script src="js/public.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/font.js"></script>
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/ui.css">
    <title></title>
    <!-- 服务中心-工单-继续留言 -->
    <style>
    </style>
</head>
<body>
<div class="scroll-content2 my-service-center-tjgd" style="overflow:auto;background: #f1f1f1;">
    <div class="top-public">
        <span class="public-center">继续留言</span>        
        <img src="images/left_icon.png" alt="" class="public-left">
    </div>
    <div class="write-detail">
        <p>问题描述</p>
        <textarea name="" id="question" cols="44" rows="6"></textarea>
    </div>
    <div class="sub-btn" onclick="sub()">完成</div>
</div>
</body>
<script>
    $('.public-left').click(function(){
        window.history.go(-1);
    })

    $(function() {
       //验证是否登陆
       var user_id = sessionStorage.getItem('userId');
        if (user_id == null) {
            alert('请先登录！');
            window.location.href = 'login.html';
        }
    });

    function sub(){
        var user_id = sessionStorage.getItem('userId');
        var wid = sessionStorage.getItem('wid');
        var question = $('#question').val();
        if (question == '') {
            alert('请输入你要描述的问题！')
        }
        $.ajax({
            url: url() + 'api/Invoice/message', //请求的url地址
            dataType: "JSON", //返回格式为json
            async: true, //请求是否异步，默认为异步，这也是ajax重要特性
            type: "post", //请求方式
            data:{
                user_id:user_id,
                wid:wid,
                comment:question,
            },
            success: function (data) {
                //请求成功时处理
                if(data.status == 1){
                    window.location.href = 'my_servicecenter_gd_gh.html';
                }if (data.status == -1) {
                    console.log(data.msg);
                }
            }
        });
    }


</script>
</html> 






